/*
 * Copyright 2021 The Kubernetes Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import 'mixins';

@mixin LabelKey {
  .kui--description-list-label-key {
    @content;
  }
}

@include LabelList {
  font-size: 0.75rem;

  @include DescriptionListTerm {
    background-color: var(--color-base02);

    &:hover {
      cursor: pointer;
      background-color: var(--color-base03);
    }
  }
}

@include LabelKey {
  font-weight: 500;
  color: var(--color-base0D);
}

/** click effect, adapted from https://codepen.io/ash_s_west/pen/GRZbvym @starpit 20220903 */
@include DescriptionListTerm {
  & {
    position: relative;
    cursor: pointer;
    user-select: none;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition-duration: 0.4s;
    -webkit-transition-duration: 0.4s; /* Safari */
  }

  &:after {
    content: '';
    display: block;
    position: absolute;
    border-radius: 2em;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.5s;
    box-shadow: 0 0 1em 0.5em var(--color-text-01);
  }

  &:active:after {
    box-shadow: 0 0 0 0 var(--color-text-01);
    position: absolute;
    border-radius: 2em;
    left: 0;
    top: 0;
    opacity: 1;
    transition: 0s;
  }

  &:active {
    top: 1px;
  }
}
